<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.welfare.admin.service.*" %>
<%
	HashList code003	= CommonUtil.getCodeList("003");		//서비스유형
	HashList code004	= CommonUtil.getCodeList("004");		//공급주체


	String s_from_dt		= StringUtil.nvl(request.getParameter("s_from_dt"), TODAY.substring(0,6)+"01");
	String s_to_dt			= StringUtil.nvl(request.getParameter("s_to_dt"), TODAY);
	String s_service_type	= StringUtil.nvl(request.getParameter("s_service_type"));
	String s_owner_code		= StringUtil.nvl(request.getParameter("s_owner_code"));


	HashMap infos = new HashMap();
	infos.put("from_dt",		s_from_dt);
	infos.put("to_dt",			s_to_dt);
	infos.put("service_type", 	s_service_type);
	infos.put("owner_code", 	s_owner_code);
 
	ServiceDAO dao 	= new ServiceDAO();
	HashList list 	= dao.selectServiceCountMonthly(infos);

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= SYSTEM_NAME %></title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#s_from_dt').mask('9999.99.99').datepicker();
		$('#s_to_dt').mask('9999.99.99').datepicker();
		$('#s_service_name').focus().select();
		$('#list').find('tr').hover(
				function () { $(this).addClass("hover"); }
			  , function () { $(this).removeClass("hover"); }
			)
			.click(function(){
				var serviceId = $(this).find('input[name="service_id"]').val();
				cfOpen('./serviceInfo.jsp?service_id=' + serviceId, 'service'+$.trim(serviceId), 800, 600);
			});
	});
	
	function fnExcel() {
		$('#searchForm').attr('action', './serviceCountMonthlyExcel.jsp');
		$('#searchForm').submit();
		$('#searchForm').attr('action', './serviceCountMonthly.jsp');
	}
	
	</script>
</head>
<body>
<div id="wrap">
	<div id="page">
		<div id="contents">
			<div class="menu_title">
				<h1>월검색빈도</h1>
				<p>관리자 > 복지자원 > <b>월검색빈도</b></p>
			</div>
			<div class="clear line_01"></div>

			<form id="searchForm" method="post" action="./serviceCountMonthly.jsp">

			<table cellpadding="0" cellspacing="0" class="table_01 mt15">
			<colgroup>
				<col width="100px" />
				<col width="240px" />
				<col width="100px" />
				<col width="200px" />
				<col width="100px" />
				<col  />
			</colgroup>
			<tr>
				<th><p>조회기간</p></th>
				<td>
					<input type="text" name="s_from_dt" id="s_from_dt" value="<%= s_from_dt %>" class="w80 c" maxlength="10"/>
					~ 
					<input type="text" name="s_to_dt" id="s_to_dt" value="<%= s_to_dt %>" class="w80 c" maxlength="10"/>
				</td>
				<th><p>서비스유형</p></th>
				<td>
					<select name="s_service_type" class="w120">
						<option value="">전체</option>
						<%= StringUtil.makeOption(code003, s_service_type) %>
					</select>
				</td>
				<th><p>공급주체</p></th>
				<td class="brx">
					<select name="s_owner_code" class="w120">
						<option value="">전체</option>
						<%= StringUtil.makeOption(code004, s_owner_code) %>
					</select>
				</td>
			</tr>
			</table>

			<div class="mt10 mb10 r">
				<input type="image" class="button" src="../images/btn_search.gif"/>
				<a href="#nohref" onclick="fnExcel()"><img src="../images/btn_excel.gif"/></a>
			</div>

			</form>



			<div class="search_result">검색결과 : <%= StringUtil.toPrice(list.size()) %>건</div>

		    <table cellpadding="0" cellspacing="0" class="table_03">
				<colgroup>
					<col width="60px"/>
					<col width="80px"/>
					<col width="120px"/>
					<col />
					<col width="180px"/>
					<col width="160px"/>
				</colgroup>
				<thead>
					<tr>
						<th><p>순위</p></th>
						<th><p>유형</p></th>
						<th><p>공급주체</p></th>
						<th class="l"><p>서비스명</p></th>
						<th class="l"><p>담당부서</p></th>
						<th><p>월조회수</p></th> 
					</tr>
				</thead>
				<tbody id="list">
			<%	for (int i = 0; i < list.size(); i++) { %>
					<tr>
						<td class="service_id">
							<%= list.get("rank", i) %>
							<input type="hidden" name="service_id" value="<%= list.get("service_id",i) %>"/>
						</td>
						<td><%= list.get("service_type", i) %></td>
						<td ><%= list.get("owner_name", i) %></td>
						<td class="l"><%= list.get("service_name", i) %></td>
						<td class="l"><%= list.get("dept_name", i) %></td>
						<td><%= list.get("hit_count", i) %></td>
					</tr>
			<%	} %>
				</tbody>
			</table>

		</div>
	</div>
</div>
</body>
</html>
